var TITLE = '设备管理';
var AUC_DOMAIN = 'http://10.150.2.63:9001';
var EMS_DOMAIN = 'http://10.150.2.63:8090';
var TAKING_DOMAIN = 'http://10.150.2.64:8090';
var REPAIR_URL = 'http://10.150.2.64:8090';

var AUC_DOMAIN64 = 'http://10.150.2.64:9001';
var EMS_DOMAIN64 = 'http://10.150.2.64:8090';


let url63 = {
	// 登录
	"LOGIN": AUC_DOMAIN + '/auc/auth/login',
	// 任务查看下拉
	"TASKLIST": EMS_DOMAIN + '/ict-supplies/api/pda/task/list',
	//设备查询
	"EQUIPMENTLIST": EMS_DOMAIN + '/ict-supplies/api/pda/supplies/equipmentList',
	//设备赋码
	"SETEQUIPMENTLIST": EMS_DOMAIN + '/ict-supplies/api/pda/supplies/addEquipmentRfid',
	//箱组查询
	"BOXLIST": EMS_DOMAIN + '/ict-supplies/api/pda/supplies/boxList',
	//箱组赋码
	"SETBOXLIST": EMS_DOMAIN + '/ict-supplies/api/pda/supplies/addBoxRfid',
	//根据箱子ID 查询设备列表
	"SUPPLIESBOXID": EMS_DOMAIN + '/ict-supplies/api/pda/supplies/box',
	//根据RFID集合查询设备信息，多个设备逗号分隔
	"SUPPLIESRFIDS": EMS_DOMAIN + "/ict-supplies/api/pda/supplies",
	//箱子绑定设备
	"SUPPLIESBIND": EMS_DOMAIN + "/ict-supplies/api/pda/supplies/bind",
	//云上传盘点单
	"TAKINGORDER": EMS_DOMAIN + "/ict-supplies/api/pda/task/takingOrder",
	//设备出入库
	"PDATASK": EMS_DOMAIN + "/ict-supplies/api/pda/task"
}
let url64 = {
	// 登录
	"LOGIN": AUC_DOMAIN64 + '/auc/auth/login',
	// 任务查看下拉
	"TASKLIST": EMS_DOMAIN64 + '/ict-supplies/api/pda/task/list',
	//设备查询
	"EQUIPMENTLIST": EMS_DOMAIN64 + '/ict-supplies/api/pda/supplies/equipmentList',
	//设备赋码
	"SETEQUIPMENTLIST": EMS_DOMAIN64 + '/ict-supplies/api/pda/supplies/addEquipmentRfid',
	//箱组查询
	"BOXLIST": EMS_DOMAIN64 + '/ict-supplies/api/pda/supplies/boxList',
	//箱组赋码
	"SETBOXLIST": EMS_DOMAIN64 + '/ict-supplies/api/pda/supplies/addBoxRfid',
	//根据箱子ID 查询设备列表
	"SUPPLIESBOXID": EMS_DOMAIN64 + '/ict-supplies/api/pda/supplies/box',
	//根据RFID集合查询设备信息，多个设备逗号分隔
	"SUPPLIESRFIDS": EMS_DOMAIN64 + "/ict-supplies/api/pda/supplies",
	//箱子绑定设备
	"SUPPLIESBIND": EMS_DOMAIN64 + "/ict-supplies/api/pda/supplies/bind",
	//云上传盘点单
	"TAKINGORDER": EMS_DOMAIN64 + "/ict-supplies/api/pda/task/takingOrder",
	//设备出入库
	"PDATASK": EMS_DOMAIN64 + "/ict-supplies/api/pda/task"
}

function checkedurlce() {
	console.log('开始')
	
	if(common.REST_URL.LOGIN.includes('63')){
		common.REST_URL = url64
	}else{
		common.REST_URL = url63
	}
	console.log(common.REST_URL)
	console.log('结束')
}
function commitdizhicheck(jqdizhi,ictdizhi){
	let REST_URL = {}
	REST_URL.LOGIN = jqdizhi + '/auc/auth/login'
	REST_URL.TASKLIST = ictdizhi + '/ict-supplies/api/pda/task/list'
	REST_URL.EQUIPMENTLIST = ictdizhi + '/ict-supplies/api/pda/supplies/equipmentList'
	REST_URL.SETEQUIPMENTLIST = ictdizhi + '/ict-supplies/api/pda/supplies/addEquipmentRfid'
	REST_URL.BOXLIST = ictdizhi + '/ict-supplies/api/pda/supplies/boxList'
	REST_URL.SETBOXLIST = ictdizhi + '/ict-supplies/api/pda/supplies/addBoxRfid'
	REST_URL.SUPPLIESBOXID = ictdizhi + '/ict-supplies/api/pda/supplies/box'
	REST_URL.SUPPLIESRFIDS = ictdizhi + "/ict-supplies/api/pda/supplies"
	REST_URL.SUPPLIESBIND = ictdizhi + "/ict-supplies/api/pda/supplies/bind"
	REST_URL.TAKINGORDER = ictdizhi + "/ict-supplies/api/pda/task/takingOrder"
	REST_URL.PDATASK = ictdizhi + "/ict-supplies/api/pda/task"
	common.REST_URL = REST_URL
}
//zy大修改
let common = {
	"SYS_NAME": TITLE,
	'REPAIR_URL': REPAIR_URL,
	"commitdizhi":(jqdizhi,ictdizhi)=>{
		commitdizhicheck(jqdizhi,ictdizhi)
	},
	"checkedulr": () => {
		checkedurlce()
	},
	"reseturl":()=>{
		reseturlce()
	},
	"REST_URL": {
		// 登录
		"LOGIN": AUC_DOMAIN + '/auc/auth/login',
		// 任务查看下拉
		"TASKLIST": EMS_DOMAIN + '/ict-supplies/api/pda/task/list',
		//设备查询
		"EQUIPMENTLIST": EMS_DOMAIN + '/ict-supplies/api/pda/supplies/equipmentList',
		//设备赋码
		"SETEQUIPMENTLIST": EMS_DOMAIN + '/ict-supplies/api/pda/supplies/addEquipmentRfid',
		//箱组查询
		"BOXLIST": EMS_DOMAIN + '/ict-supplies/api/pda/supplies/boxList',
		//箱组赋码
		"SETBOXLIST": EMS_DOMAIN + '/ict-supplies/api/pda/supplies/addBoxRfid',
		//根据箱子ID 查询设备列表
		"SUPPLIESBOXID": EMS_DOMAIN + '/ict-supplies/api/pda/supplies/box',
		//根据RFID集合查询设备信息，多个设备逗号分隔
		"SUPPLIESRFIDS": EMS_DOMAIN + "/ict-supplies/api/pda/supplies",
		//箱子绑定设备
		"SUPPLIESBIND": EMS_DOMAIN + "/ict-supplies/api/pda/supplies/bind",
		//云上传盘点单
		"TAKINGORDER": EMS_DOMAIN + "/ict-supplies/api/pda/task/takingOrder",
		//设备出入库
		"PDATASK": EMS_DOMAIN + "/ict-supplies/api/pda/task",


		// 重置密码
		"RESET_PASSWORD": AUC_DOMAIN + '/auc/auth/modifyPw',
		// 获取菜单
		"auth_getAppMenus": AUC_DOMAIN + '/auc/auth/getAppMenus',
		// APP自动升级
		"CHECK_UPGRADE": EMS_DOMAIN + '/ecs/api/open/box/checkupgrade/6/',
		// APP自动升级
		"UPGRADE": EMS_DOMAIN + '/ecs/api/open/box/upgrade/',
		// 登录获取院区
		"deptOrgs": EMS_DOMAIN + '/ecs/api/dept/orgs',
		// 快捷盘点获取科室
		"deptDept": EMS_DOMAIN + '/ecs/api/dept/depts/',
		// 设备运行数据
		"portletDeviceInfo": EMS_DOMAIN + '/ecs/api/portlet/device-info',

		// ############### 资产盘点
		// 资产轨迹
		"task_fence_track": TAKING_DOMAIN + '/taking/api/fence/remove/history/device',
		// 获取任务列表
		"task_receive": TAKING_DOMAIN + '/taking/api/taking/task/receive-sql/',
		// 提交盘点结果
		"task_submit": TAKING_DOMAIN + '/taking/api/taking/task/submit/',
		// 提交设备绑定结果
		"task_rfid_bind": TAKING_DOMAIN + '/taking/api/taking/rfid/batch/',
		// 快捷提交任务
		"task_quick_submit": TAKING_DOMAIN + '/taking/api/taking/task/quick/submit/',
		// 设备状态
		"task_device_status": TAKING_DOMAIN + '/taking/api/taking/device/status',
		// 领取某科室所有资产信息
		"task_receive_dept": TAKING_DOMAIN + '/taking/api/taking/task/receive-dept',
	},
	//使用的功能
	"isUsed": {
		'taking': true,
		'storage': true,
		'repair': true
	},
	"REST_CODE": {
		"SUCCESS": {
			"CODE": 0
		},
		"FAILED": {
			"CODE": -100001
		},
		"TOKEN_TIME_OUT": {
			"NAME": "令牌过期",
			"CODE": 401
		},
		"ILLEGAL_TOKEN": {
			"NAME": "非法令牌",
			"CODE": -50002
		}
	},
	// rest接口10秒自动超时
	"REST_TIMEOUT": 2000,

	// 请求后页面跳转时间间隔，等待toast结束
	"PAGE_CUT_INTERVAL": 500,

	"FLAGS": {
		// 测试按钮，默认false
		"TEST_FLAG": true,
		// 入参校验开关, 便于调试  默认true
		"VALIDATE_FLAG": true
	},

	"TIMER": {
		"UPLOAD_BINDIND_INFO_INTERVAL": 10000,
		"UPLOAD_BINDIND_INFO_FLAG": false,
		// 盘点任务提交定时器
		"UPLOAD_TAKING_INFO_INTERVAL": 10000,
		"UPLOAD_TAKING_INFO_FLAG": false,
	},

	"TTS_ENGINE": [{
			// 度秘语音引擎3.0 不支持5.0以下系统，大小11.95M
			"e": "com.baidu.duersdk.opensdk",
			// //音调
			// "pitch": 80,
			// //语速
			// "speed": 100
		},
		// 科大讯飞语音引擎3.0，支持4.0以上系统
		{
			"e": "com.iflytek.speechcloud"
		}
	],

	// RFID标签设置
	"RFID": {
		// RFID码前缀FC
		"PREFIX": "FC",
		// PDA最小功率，用于贴近扫描的功能
		"PDA_POWER_MIN": 5,
		// PDA最大的功率，用于盘点等
		"PDA_POWER_MAX": 30,
	}
}
export default common